<?php
/**
 * 	Bushido
 *
 * @category   Bushido
 * @package    Bushido_Report
 * @copyright  Copyright (c) 2008-2009 Nathan Keyes
 * @author Nathan Keyes
 * @version    $Id: Report.php 7 2009-11-14 22:42:08Z nkeyes $
 */

/**
 * Report Factory class
 * @see Bushido_Report_Abstract
 */
class Bushido_Report
{
	
	/**
	 * Report Factory function
	 * 
	 * @return Bushido_Report_Abstract
	 * @param $reportName Object
	 * @param $action Object[optional]
 	 */
	public static function getReport($reportName, Zend_Controller_Action $action = NULL)
	{
		$reportClassName = $reportName;
		$reportObject = new $reportClassName();
		if(false !== array_search('Bushido_CustomViewInterface', class_implements($reportObject)) && $action != NULL)
		{
			$reportObject->initData($action);
			$reportObject->initView($action);
		}
		
		return $reportObject;
	}
	
}
